// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'



import './assets/css/reset.css'  //公共css
import Multiplex from './components/Multiplex'   //组件
Vue.use(Multiplex);

// toast提示
import  { ToastPlugin } from 'vux'
Vue.use(ToastPlugin)


//添加 Fastclick 移除移动端点击延迟
const FastClick = require('fastclick')
FastClick.attach(document.body)

Vue.config.productionTip = false


//获取url参数
function getQueryString(name) { 
  var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); 
  var r = window.location.search.substr(1).match(reg); 
  if (r != null) return unescape(r[2]); return null; 
}

//window.localStorage.clear();

var userid = getQueryString('id');

// console.log(userid);
//用户标识
if(userid){
  window.localStorage.Authorizations = userid;
}




//全局注入  vux的alert
// Vue.prototype.$msgbox = function(title, msg) {
//     this.$vux.alert.show({
//         title: title,
//         content: msg
//     });
// }


//三种请求方式
import {ApiPost, ApiGet, ApiPut} from './config/userconf'
Vue.prototype.$httpPost = ApiPost;
Vue.prototype.$httpGet = ApiGet;
Vue.prototype.$httpPut = ApiPut;



/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
